﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
using System.Data.SqlClient;
using System.IO;

namespace Tamaris
{
    public partial class Map : Form
    {
        public Main main;

        public Map()
        {
            InitializeComponent();
        }

        public Map(Main m):this()
        {
            main = m;
        }

        private void Map_Load(object sender, EventArgs e)
        {

        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            OracleConnection con = new OracleConnection("user id=tamaris;password=Tamaris1;data source=10.154.126.50:1521/tama");
            con.Open();
            OracleCommand cmd = new OracleCommand("PACK_EMPLACEMENT.EMPLACEMENT_OCCUP_BY_TYPE", con);
            cmd.CommandType = CommandType.StoredProcedure;

            OracleParameter c1 = new OracleParameter("c1", OracleDbType.RefCursor, 50);
            c1.Direction = ParameterDirection.ReturnValue;
            cmd.Parameters.Add(c1);

            OracleDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                listBox1.Items.Add(reader["num_emplacement"].ToString());
            }
        }
    }
}
